using NAnt.Core.Attributes;

namespace Sentient.Nant.Tasks
{
    [TaskName("db.connection_string")]
    public class CreateConnectionStringTask : NHibernateTask
    {
        private string _propertyName;

        [TaskAttribute("name", Required = true), StringValidator(AllowEmpty = false)]
        public string PropertyName
        {
            get { return _propertyName; }
            set { _propertyName = value; }
        }

        protected override void ExecuteTask()
        {
            Properties[PropertyName] = ConnectionString.ToString();
        }
    }
}